[QNN EP] Address PR #602 review comments (N-1 vacuous tests, T-1 line drift) - #719
Draft
yuhuchua-qti wants to merge 2 commits into
Draft
[QNN EP] Address PR #602 review comments (N-1 vacuous tests, T-1 line drift)#719yuhuchua-qti wants to merge 2 commits into
yuhuchua-qti wants to merge 2 commits into
Conversation
…-number drift) Follow-up to PR #602. [N-1] Group 10 ValidateCompiledModelCompatibilityInfo tests were vacuous on x86_64. ValidateCompiledModelCompatibilityInfo has an `#if !defined(__aarch64__)` guard that logs WARNING "Skip compatibility validation on x86 platforms." and returns EP_NOT_APPLICABLE before any field parsing. On x86_64 (the only host where QNN_EP_INTERNAL_SYMBOL_ACCESS is set), any non-empty input trips the guard, so the previous `TooFewFields` and `BadVersionFormat` tests were both just testing the same x86-skip branch under different names. - Consolidated `TooFewFields` + `BadVersionFormat` into a single honestly-named `NonEmptyOnX86Host_LogsSkipAndReturnsNotApplicable`. - Renamed `EmptyString_NotApplicable` -> `EmptyString_LogsNoInfoAndReturnsNotApplicable`. - Both tests now assert the actual WARNING log via `ExpectLogged`, empirically verifying which branch fires (confirmed the x86-skip WARNING fires for the 6-field input `1:1.0.0:2.1.0:3.0.0:73:0`). - Group 10 header now documents that the field-parsing branches are unreachable on this coverage host. [T-1] Replaced absolute source line numbers (301 / 547 / 1084) in test comments with function names, so they don't drift when the source file changes. Line 547 had already drifted to 523 and 1084 to 1240 in the current source. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Adds Ctor_HtpFp16ClampOverflowTrueOnUnsupportedSdk_LogsWarning covering the ctor warning branch at qnn_execution_provider.cc:922-926, which fires when enable_htp_fp16_clamp_overflow=1 but QNN_HTP_FP16_CLAMP_OVERFLOW_AVAILABLE is not defined (QNN API < 2.38 / QAIRT < 2.49). The coverage build uses QAIRT 2.48 = QNN API 2.37, so the warning branch is compiled in. Addresses reviewer question on PR #602: `enable_htp_fp16_clamp_overflow` was introduced in #686 (2 days before #602 merged) and had integration smoke test coverage in conv_test.cc but no unit-tier coverage of the ctor warning. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Follow-up to PR #602 review comments from @huaychou.
[N-1] Group 10
ValidateCompiledModelCompatibilityInfotests were vacuous on x86_64ValidateCompiledModelCompatibilityInfoinqnn_execution_provider.cchas:Any non-empty info string trips that guard on x86_64, so the previous
TooFewFields_NotApplicableandBadVersionFormat_NotApplicabletests were both hitting the same x86-skip branch (empirically verified viaExpectLogged(WARNING, "Skip compatibility validation on x86 platforms.")).Fix:
TooFewFields_NotApplicable+BadVersionFormat_NotApplicable-> singleNonEmptyOnX86Host_LogsSkipAndReturnsNotApplicable.EmptyString_NotApplicable->EmptyString_LogsNoInfoAndReturnsNotApplicable.ExpectLoggedthe actual WARNING each branch emits.[T-1] Absolute line-number references in comments
Replaced absolute source line numbers (
line 301/547/1084) in 5 test comments with function names, so they don't drift when the source file changes. Line 547 had already drifted to 523 and 1084 to 1240 in the current source, illustrating the issue.Bonus:
enable_htp_fp16_clamp_overflowwarning branchReviewer also asked whether
enable_htp_fp16_clamp_overflowneeds a unit test. The option was introduced in #686 (merged 2 days before #602) but wasn't picked up by #602's ctor option tests. AddedCtor_HtpFp16ClampOverflowTrueOnUnsupportedSdk_LogsWarningcovering the ctor warning branch atqnn_execution_provider.cc:922-926. The coverage build (QAIRT 2.48 = QNN API 2.37) does not defineQNN_HTP_FP16_CLAMP_OVERFLOW_AVAILABLE, so the#ifndefbranch is compiled in and reachable.Integration smoke coverage already exists in
conv_test.cc:1195(added by #686).Test plan
onnxruntime_provider_test --gtest_filter="QnnUnit_ExecutionProviderTest.*:QnnUnit_ExecutionProviderHtpTest.*"— 65/65 passlint_and_fixcleanRef: #602, #686